// new Promise(function (resolve) {
//   resolve()
// }).then(function () {
//   console.log('then')
// })
Promise.resolve().then(() => { console.log('then1') })
Promise.resolve().then(() => { console.log('then2') })
let n1 = 0
function nt() {
  console.log('nt')
  if (n1 < 10) {
    n1++
    Promise.resolve().then(function () {
      process.nextTick(nt)
    })
  }
}
let n2 = 0
function nt2() {
  console.log('nt' + n2)
  if (n2 < 10) {
    n2++
    process.nextTick(nt2)
  }
}
nt()
nt2()
Promise.resolve().then(() => { console.log('then3') })
